package com.itheima.dao;

import com.itheima.DTOAndVO.OrderVO;
import com.itheima.pojo.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

@Mapper
public interface OrderDao {
//   查询 用户在某天天预约了某一个套餐
    @Select("select * from t_order o,t_member m where o.member_id=m.id and o.orderDate=#{date} and m.name=#{name} and o.setmeal_id=#{setmealId};")
    List<Order> findByNameAndOrderDate(Date date,String name,Integer setmealId);

    void insert(Order order);

    @Select("select orderType,m.name as member, orderDate, setmeal_id as setmeal " +
            "from t_order o,t_member m where o.member_id=m.id and o.id=#{orderId};")
    OrderVO findById(Integer orderId);
}
